﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MS.InformationManagement.Presenter.Support;

namespace MS.InformationManagement.Presenter.AddToExpediente
{
    public class AddToExpedientePresenter : BasePresenter<IAddExpedienteView>
    {
        #region Constructor

        public AddToExpedientePresenter(IAddExpedienteView view) : base(view) { }

        #endregion

        #region Public Methods

        public void SearchExpediente()
        {
            View.ExpedienteEntity = new BLL.AddRadicadoToExpediente.AddToExpediente().GetExpediente(View.SelectedExpedienteId);
            View.ShowFoundedExpediente();
        }

        public void HandleLoad()
        {
            View.SelectedRadicadoNumber = new BLL.AddRadicadoToExpediente.AddToExpediente().GetRadicadoNumber(Convert.ToInt32(View.SelectedRadicadoId)
                , View.CurrentListName);
        }

        public void AddToExpediente()
        {
            if (View.ExpedienteEntity != null)
            {
                new BLL.AddRadicadoToExpediente.AddToExpediente().Include(View.SelectedRadicadoId, View.SelectedExpedienteId, View.CurrentListName);
                View.RadicadoAdded();
            }
        }

        #endregion
    }
}
